<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>商品信息</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="../../../elementUI/index.css">
  <link rel="stylesheet" href="../../../css/index.css">
</head>

<body>
  <div id="app" class="minWidth">
    <el-form :inline="true" :form="form">
      <el-form-item>
        <el-button type="danger">批量下架</el-button>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="addEnterprise">添加</el-button>
      </el-form-item>
      <el-form-item>
        <el-input v-model="form.serachKey" placeholder="请输入内容" />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSerach">查询</el-button>
      </el-form-item>
    </el-form>

    <el-table :data="tableData.slice((form.page-1)*form.limit,form.page*form.limit)" stripe border
      height="calc(100vh - 140px)" @expand-change="handleChildren" @selection-change="handleSelectionChange"
      style="width: 100%">
      <el-table-column type="expand" width="60">
        <template slot-scope="props">
          <el-table :data="props.row.Children.article_specifications">
            <el-table-column type="index" width="50" label="序号"></el-table-column>
            <el-table-column prop="Article_Specifications_SerialNumber" label="规格编号"></el-table-column>
            <el-table-column prop="Specifications_Name" label="产品规格"></el-table-column>
            <el-table-column prop="Picture_URL" label="图片" width="125">
              <template v-slot="{row}">
                <el-image style="width: 100px; height: 100px; border-radius: 9px;"
                  class="el-upload-list__item-thumbnail" :src="DomainIMG + row.Picture_URL" fit="contain"></el-image>
              </template>
            </el-table-column>
            <el-table-column prop="Net_Content" label="净含量"></el-table-column>
            <el-table-column prop="Unit_Price" label="零售价"></el-table-column>
            <el-table-column prop="Packing" label="装箱数"></el-table-column>
            <el-table-column prop="PackingSize" label="装箱尺寸"></el-table-column>
            <el-table-column prop="OutsidePackingSize" label="外箱尺寸"></el-table-column>
          </el-table>
        </template>
      </el-table-column>
      <el-table-column type="selection" width="60"></el-table-column>
      <el-table-column label="序号" width="50" type="index"></el-table-column>
      <el-table-column prop="Article_SerialNumber" width="170" label="商品流水号"></el-table-column>
      <el-table-column label="商品图片" width="125">
        <template v-slot="{row}">
          <el-image style="width: 100px; height: 100px; border-radius: 9px;" fit="cover"
            @click="handlePreview(row.Article_SerialNumber)" :src="DomainIMG + row.Picture_URL"
            :preview-src-list="Pic"></el-image>
        </template>
      </el-table-column>
      <el-table-column prop="Article_Name" label="商品名"></el-table-column>
      <el-table-column prop="Row_Status" label="状态" width="80">
        <template v-slot="{row}">
          <el-tag v-if="row.Row_Status==0" size="small">未下架</el-tag>
          <el-tag v-else type="danger" size="small">已下架</el-tag>
        </template>
      </el-table-column>
      <el-table-column prop="Release_Type" label="状态" width="80">
        <template v-slot="{row}">
          <el-tag v-if="row.Release_Type==0" type="danger" size="small">未发布</el-tag>
          <el-tag v-else size="small">已发布</el-tag>
        </template>
      </el-table-column>
      <el-table-column prop="Brand_Name" label="品牌"></el-table-column>
      <el-table-column prop="Category_Name" label="类别"></el-table-column>
      <el-table-column prop="Series_Name" label="系列">
        <!-- <template v-slot="{row}">
          {{row.Series_SerialNumber}}
        </template> -->
      </el-table-column>
      <el-table-column prop="Item_Name" label="款型"></el-table-column>
      <el-table-column prop="Unit_Price" label="吊牌价"></el-table-column>
      <el-table-column prop="Enterprise_Name" label="所属企业"></el-table-column>
      <el-table-column label="操作" width="200">
        <template v-slot="{row}">
          <div v-show="row.Enterprise_Info_SerialNumber==Enterprise_Info_SerialNumber">
            <el-button type="primary" size="small" @click="showMember(row.Article_SerialNumber)">添加规格</el-button>
            <el-button type="warning" size="small" v-show="row.Row_Status=='0'"
              @click="deletMember(row.Article_SerialNumber)">下架</el-button>
            <el-button type="success" size="small" v-show="row.Row_Status=='1'"
              @click="deletMember(row.Article_SerialNumber)">上架</el-button>
            <el-button type="info" size="small"
              v-show="row.Release_Type=='1'&&row.Enterprise_Info_SerialNumber==Enterprise_Info_SerialNumber"
              style="margin-top: 10px;" @click="stateMember(row)" :loading="loading">隐藏</el-button>
            <el-button type="success" size="small"
              v-show="row.Release_Type=='0'&&row.Enterprise_Info_SerialNumber==Enterprise_Info_SerialNumber"
              style="margin-top: 10px;" @click="stateMember(row)" :loading="loading">发布</el-button>
            <el-button type="danger" size="small" style="margin-top: 10px;"
              @click="omitMember(row.Article_SerialNumber)">删除</el-button>
          </div>
        </template>
      </el-table-column>
    </el-table>
    <!-- <el-dialog title="多层价格" :visible.sync="dialogFormVisible">
      <div class="operation">
        <el-button type="primary" size="small" @click="add_article_specifications">新增</el-button>
        <el-button type="danger" size="small" @click="remove_article_specifications">删除</el-button>
      </div>
      <el-descriptions :column="3" border size="small" v-for="(item,index) in Multistage" :key="index">
        <el-descriptions-item label="价格">
          <el-input v-model.trim="item.Unit_Price" placeholder="请输入零售价"></el-input>
        </el-descriptions-item>
        <el-descriptions-item label="数量">
          <el-input v-model.trim="item.Quantity" placeholder="请输入数量"></el-input>
        </el-descriptions-item>
      </el-descriptions>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="UploadPrice">确 定</el-button>
      </div>
    </el-dialog> -->
    <el-pagination background v-show="total > 0" @size-change="handleSizeChange" @current-change="handleCurrentChange"
      :current-page="form.page" :page-sizes="[10,20,30,50]" :page-size="form.limit"
      layout="total, sizes, prev, pager, next, jumper" :total="total">
    </el-pagination>
  </div>
  <script type="text/javascript" src="../../../js/jquery-3.6.0.min.js"></script>
  <script type="text/javascript" src="../../../js/jquery.cookie.js"></script>
  <script type="text/javascript" src="../../../js/vue.min.js"></script>
  <script type="text/javascript" src="../../../elementUI/index.js"></script>
  <script type="text/javascript" src="../../../js/utils.js"></script>
  <script type="text/javascript" src="./js/EnterpriseGoods.js"></script>
</body>

</html>